<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.model.User"%>
<%@page import="com.is.control.UserControl"%>
<%@page import="com.is.util.ParamUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<% 
	int uid = ParamUtil.getInt(request,"uid",-1);
	int flag = ParamUtil.getInt(request,"flag",0);
	String role = ParamUtil.getString(request,"role","");
	User u = new User();
	if(uid == -1){
		u = (User)session.getAttribute("user");
	} else{
		u = UserControl.getUserById(uid);
	}
%>
<body>
姓名<%=u.getName() %>
用户名<%=u.getUsername() %>
密码<%=u.getPassword() %>
角色<%out.print((u.getRole().equals("0"))?"老师":"管理员"); %>
<% 
	if(u.getRole().equals("1")){	
%>
课程
<% 
	}
	if(flag == 1){
%>
添加新用户成功，<a href="user_add.jsp">继续添加</a>
<% 
	} else{
%>
<a href="user_all.jsp?role=<%=role %>">返回列表</a>
<% 
	}
%>
</body>
</html>